/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package negocio;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import org.primefaces.model.chart.MeterGaugeChartModel;

/**
 *
 * @author eriksigcha
 */
@Entity
@Table(name = "semaforo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Semaforo.findAll", query = "SELECT s FROM Semaforo s"),
    @NamedQuery(name = "Semaforo.findByIdsemaforo", query = "SELECT s FROM Semaforo s WHERE s.idsemaforo = :idsemaforo"),
    @NamedQuery(name = "Semaforo.findByLsuperior", query = "SELECT s FROM Semaforo s WHERE s.lsuperior = :lsuperior"),
    @NamedQuery(name = "Semaforo.findByLinferior", query = "SELECT s FROM Semaforo s WHERE s.linferior = :linferior")})
public class Semaforo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idsemaforo")
    private Integer idsemaforo;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "lsuperior")
    private Float lsuperior;
    @Column(name = "linferior")
    private Float linferior;
    @JoinColumn(name = "color_idcolor", referencedColumnName = "idcolor")
    @ManyToOne(optional = false)
    private Color colorIdcolor;
    @JoinColumn(name = "indicador_idindicador", referencedColumnName = "idindicador")
    @ManyToOne(optional = false)
    private Indicador indicadorIdindicador;

    public Semaforo() {
    }

    public Semaforo(Integer idsemaforo) {
        this.idsemaforo = idsemaforo;
    }

    public Integer getIdsemaforo() {
        return idsemaforo;
    }

    public void setIdsemaforo(Integer idsemaforo) {
        this.idsemaforo = idsemaforo;
    }

    public Float getLsuperior() {
        return lsuperior;
    }

    public void setLsuperior(Float lsuperior) {
        this.lsuperior = lsuperior;
    }

    public Float getLinferior() {
        return linferior;
    }

    public void setLinferior(Float linferior) {
        this.linferior = linferior;
    }

    public Color getColorIdcolor() {
        return colorIdcolor;
    }

    public void setColorIdcolor(Color colorIdcolor) {
        this.colorIdcolor = colorIdcolor;
    }

    public Indicador getIndicadorIdindicador() {
        return indicadorIdindicador;
    }

    public void setIndicadorIdindicador(Indicador indicadorIdindicador) {
        this.indicadorIdindicador = indicadorIdindicador;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idsemaforo != null ? idsemaforo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Semaforo)) {
            return false;
        }
        Semaforo other = (Semaforo) object;
        if ((this.idsemaforo == null && other.idsemaforo != null) || (this.idsemaforo != null && !this.idsemaforo.equals(other.idsemaforo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "negocio.Semaforo[ idsemaforo=" + idsemaforo + " ]";
    }
    
}
